// component/empty-view/empty-view.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    type: {
      type: Number,
      default: 0
    },
    showBtn: {
      type: Boolean,
      default: false,
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    empty_images: {
       0: {
        name: "暂无搜索结果",
        imgUrl: "../../images/empty/no-search.png",
        btnStr: "刷新"
      },
      1: {
        name: "暂无优惠券",
        imgUrl: "../../images/empty/no-coupons.png",
        btnStr: "刷新"
      },
      2: {
        name: "暂无商品",
        imgUrl: "../../images/empty/no.png",
        btnStr: "刷新"
      },
      3: {
        name: "暂无收益",
        imgUrl: "../../images/empty/no-shouyi.png",
        btnStr: "刷新"
      },
      4: {
        name: "暂无收货地址",
        imgUrl: '../../images/empty/no-address.png',
        btnStr: "添加收货地址"
      },
      5: {
        name: "暂无订单哦",
        imgUrl: "../../images/empty/no.png",
        btnStr: "刷新"
      },
      6: {
        name: "暂无消息",
        imgUrl: "../../images/empty/no-message.png",
        btnStr: "刷新"
      },
      7: {
        name: "暂无银行卡",
        imgUrl: "../../images/empty/no-card.png",
        btnStr: "刷新"
      },
      8: {
        name: "网络出问题啦",
        imgUrl: "../../images/empty/no-network.png",
        btnStr: "重试"
      },
      9:{
        name: "还没有粉丝关注你哦~",
        imgUrl: "../../images/empty/no.png",
        btnStr: "重试"
      },
      10:{
        name: "您还没有关注别人哦~",
        imgUrl: "../../images/empty/no.png",
        btnStr: "重试"
      },
      11:{
        name: "还没有发布任何分享哦~",
        imgUrl: "../../images/empty/no.png",
        btnStr: "重试"
      },
       12:{
        name: "您还没有收藏哦",
        imgUrl: "../../images/empty/no.png",
        btnStr: "重试"
      },
       13:{
        name: "暂无评价哦",
        imgUrl: "../../images/empty/no.png",
        btnStr: "重试"
      },
      14:{
        name: "购物车空空如也",
        imgUrl: "../../images/empty/no.png",
        btnStr: "重试"
      }
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    refresh: function(e) {
      if (this.data.type == 4) {
        this.triggerEvent('add', {
          e: e
        }) // 将e通过参数的形式传递给父组件
      }
      this.triggerEvent('refresh', {
        e: e
      }) // 将e通过参数的形式传递给父组件
    }
  }
})